<?php
namespace Zhub\HttpMessage;

use Zhub\HttpMessage\Headers\RequestHeader;
use Zhub\Uri\Url\UrlStruct;

class Request extends Message
{
	const METHOD = 'method';

	const URL = 'url';


	public function getMethod():int
	{
		return $this->get(self::METHOD);
	}

	public function setMethod(int $method)
	{
        $this->set(self::METHOD, $method);
	}

	public function getUrl():UrlStruct
	{
		return $this->get(self::URL);
	}

	public function setUrl(UrlStruct $url)
	{
        $this->set(self::URL, $url);
	}

    public function getHeader():RequestHeader
    {
        return $this->get(self::HEADER);
    }

    public function setHeader(RequestHeader $headers = null)
    {
        $this->set(self::HEADER, $headers);
    }

	public static function initialize():array
	{
		return array_merge(parent::initialize(), [
            self::METHOD => RequestMethod::GET,
            self::URL => function () {return UrlStruct::class;},
	        self::HEADER => function () {return RequestHeader::class;}
		]);
	}

}
